﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Empires.CRL.DataContract;
using System.Web;
using Empires.BLL.Core.IService;
using Empires.BLL.Core.Implement;

namespace Empires.PL.ServiceClient
{
    public class ServiceProviderServiceClient
    {
        public static Dictionary<string, string> UploadFiles(List<UploadFileDataPack> files, HttpFileCollection upload)
        {
            return Empires.BLL.ServerProvider.Tools.UploadFiles(files, upload);
        }
        public static List<DefaultDataPack> GetAuthInfo(string copname, string username)
        {
            return Empires.BLL.ServerProvider.RoleCheckProvider.GetAuthInfo(copname, username);
        }
        public static int ProcessMainInfoRequest(MainInfoDataPack model)
        {
            if (!String.IsNullOrEmpty(model.Photo) && !String.IsNullOrEmpty(model.Link))
            {
                ICompanyLinksService service = new CompanyLinksService();
                if (model.InfoID == -1) //新添项
                {
                    return service.AddItemForMainInfo(model);
                }
                else //编辑项
                {
                    return service.UpdateItemForMainInfo(model);
                }
            }
            return -1;
        }
    }
}
